import { BoxGeometry, MathUtils, Mesh, MeshStandardMaterial } from 'three';
function createCube() {
  const geometry = new BoxGeometry(2, 2, 2);

  // Switch the old "basic" material to
  // a physically correct "standard" material
  const material = new MeshStandardMaterial({ color: 'purple' });

  const cube = new Mesh(geometry, material);

  cube.rotation.set(-0.5, -0.1, 0.8);

  return cube;
}

function createTransformCube() {
  const geometry = new BoxGeometry(2, 2, 2);

  const material = new MeshStandardMaterial({ color: 'purple' });

  const cube = new Mesh(geometry, material);

  cube.position.set(-0.5, -0.1, 1);

  // equivalent to:
  // cube.position.x = -0.5;
  // cube.position.y = -0.1;
  // cube.position.z = 1;

  cube.scale.set(1.25, 0.25, 0.5);

  // equivalent to:
  // cube.scale.x = 1.25;
  // cube.scale.y = 0.25;
  // cube.scale.z = 0.5;

  // to rotate using degrees, they must
  // first be converted to radians

  cube.rotation.set(MathUtils.degToRad(-60), MathUtils.degToRad(-45), MathUtils.degToRad(60));

  return cube;
}
export { createCube, createTransformCube };
